﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListArticles.ascx.cs" Inherits="Web.Cms.Content.Articles.ListArticles" %>
<%@ Register src="~/Cms/AjaxCP/Paging.ascx" tagname="PagingAjax" tagprefix="uc1" %>

<script type="text/javascript">
    $(function () {
        $("#<%=txtStartDate.ClientID %>").datepicker({ showOn: 'button', buttonImage: '/images/calendar_1.gif', buttonImageOnly: true });
        $("#<%=txtEndDate.ClientID %>").datepicker({ showOn: 'button', buttonImage: '/images/calendar_1.gif', buttonImageOnly: true });
    });
</script>
<div >
<p class="heading">
    <asp:Label runat="server" ID="lbTitle"></asp:Label>
</p>     
<p class="clear8px">
</p>
<table cellpadding="3" cellspacing="3" border="0">
    <tr>
        <td align="center"><b>Từ khóa</b></td>
        <td align="center"><b>Từ ngày</b></td>    
        <td align="center"><b>Đến ngày</b></td>
        <td align="center"><b>Nằm trong chuyên mục</b></td>
        <td style="width:5px;"></td>
        <td></td>
    </tr>
    <tr>        
        <td><asp:TextBox ID="txtKeyword" runat="server" Width="200px" Height="20px"></asp:TextBox></td>        
        <td valign="top"><asp:textbox CssClass="input-txt" id="txtStartDate" runat="server" Height="18px"></asp:textbox> 
		</td>          
        <td valign="top">
            <asp:textbox CssClass="input-txt" id="txtEndDate" runat="server" Height="18px"></asp:textbox>             
		</td>                  
        <td><asp:DropDownList runat="server" ID="DropZone" Height="20px"></asp:DropDownList></td>               
        <td style="width:5px;"></td>
         <td  valign="top">
            <asp:Button ID="btnSearch" runat="server" Width="65px" Height="24px" SkinID="AdminButtonSearch"/>
        </td>       
    </tr>
    <tr><td style="height:10px;" colspan="7"></td></tr>
</table>
<strong><asp:Label ForeColor="red" runat="server" ID="lberror"></asp:Label></strong>

<asp:DataGrid runat="server" ID="dgrContents" AutoGenerateColumns="false" BorderColor="Gainsboro"
	BorderStyle="solid" BorderWidth="1px" CellPadding="2" CellSpacing="0" CssClass="Grid"
	Width="100%" AlternatingItemStyle-BackColor="#ffffff" OnItemCommand="dgrContents_RowCommand">	
	<HeaderStyle CssClass="labe_Caption" Font-Bold="True" HorizontalAlign="Left" />    
	<ItemStyle HorizontalAlign="Center" />
    <Columns>
        <asp:TemplateColumn HeaderStyle-CssClass="TitleContents" HeaderStyle-Width="10">
            <HeaderTemplate>STT</HeaderTemplate>
            <ItemTemplate>
                <asp:Label ID="lblStt" runat="server"></asp:Label>
                <asp:Label ID="lblContentID" runat="server" Visible="false" Text='<%#Eval("contentlangid") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateColumn>  
        <asp:TemplateColumn HeaderText="Tiêu đề" ItemStyle-CssClass="TitleContents" ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="left">            
            <ItemTemplate>  
                <%#Eval("Headline")%>
            </ItemTemplate>
        </asp:TemplateColumn>  
        <asp:TemplateColumn HeaderText="Trạng thái" HeaderStyle-Width="70px" ItemStyle-CssClass="TitleContents" ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="center">
            <ItemTemplate>                
                <asp:Label ID="lbStatus" runat="server"></asp:Label>                               
            </ItemTemplate>
        </asp:TemplateColumn> 
        <asp:TemplateColumn HeaderStyle-Width="120px" HeaderText="Ngày tạo mới" ItemStyle-CssClass="TitleContents" ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="center">            
            <ItemTemplate>
                <%#Eval("CreatedOn")%>
            </ItemTemplate>
        </asp:TemplateColumn>   
        <asp:TemplateColumn HeaderText="Người tạo mới" HeaderStyle-Width="80" ItemStyle-CssClass="TitleContents" ItemStyle-HorizontalAlign="center" ItemStyle-VerticalAlign="Top">
            <ItemTemplate>                             
                <%#Eval("Username")%>                               
            </ItemTemplate>
        </asp:TemplateColumn> 
        <asp:TemplateColumn HeaderText="Xem" ItemStyle-CssClass="TitleContents" ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="center" HeaderStyle-Width="20">            
            <ItemTemplate>
                <a href="javascript:void(0)" onclick="javascript:return showPopWinADMIN('../Cms/Content/Articles/ArticlesView.aspx?contentId=<%#Eval("contentId") %>','Xem bài viết chi tiết',550,490,null,__doPostBack)"><img src="/App_Themes/Default/Images/Buttons/views.gif" style="border:0px;" /></a>                               
            </ItemTemplate>
        </asp:TemplateColumn>   
        <asp:TemplateColumn ItemStyle-CssClass="TitleContents" ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="center" HeaderText="Edit" HeaderStyle-Width="20">            
            <ItemTemplate>                  
                <asp:Button ID="btnEdit" runat="server" SkinID="IconFileEdit" ToolTip="Sửa" CommandArgument='<%# Eval("ContentID") %>'
                        CommandName="edit" />
            </ItemTemplate>            
        </asp:TemplateColumn> 
        <asp:TemplateColumn ItemStyle-CssClass="TitleContents" ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="center" HeaderText="Xóa" HeaderStyle-Width="20">            
            <ItemTemplate>
                <asp:Button ID="btnDelete" runat="server" CssClass="Icon_Delete" CommandArgument='<%# Eval("ContentID") %>' CommandName="Commanddelete" OnClientClick="return confirm('Bạn có chắc chắn xóa không ?')" />   
                <asp:Label Visible="false" runat="server" ID="lbContentID" Text='<%#Eval("ContentID") %>'></asp:Label>
            </ItemTemplate>                        
        </asp:TemplateColumn>  
        <asp:TemplateColumn ItemStyle-CssClass="TitleContents" ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="center" HeaderStyle-Width="20">            
            <ItemTemplate>                  
                <asp:ImageButton ID="btnStatus" runat="server" CommandArgument='<%# Eval("ContentID") %>' CommandName="CommandStatus" />   
            </ItemTemplate>            
        </asp:TemplateColumn>                                   
        <asp:TemplateColumn HeaderText="Chuyên mục" ItemStyle-CssClass="TitleContents" ItemStyle-VerticalAlign="Middle" HeaderStyle-Width="150" HeaderStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#Eval("Title") %>             
            </ItemTemplate>
        </asp:TemplateColumn>      
    </Columns>
</asp:DataGrid>
<br />
<table cellspacing="0" cellpadding="0" border="0" width="100%">   
    <tr>
         <td colspan="4"> <asp:Label runat="server" ID="lbmesage" Font-Bold="True" Font-Names="Arial" Font-Size="11px" ForeColor="Red"></asp:Label>                  
         </td>         
    </tr>  
    <tr><td align="right" colspan="4"><b>Ghi chú:  </b> <asp:Label runat="server" ID="lbstatus"></asp:Label></td></tr> 
    <tr><td align="right" colspan="4"><img src="/App_Themes/Default/Images/Buttons/i_rate.gif" />Chỉnh sửa bài viết</td></tr> 
    <tr><td align="right" colspan="4"><img src="/App_Themes/Default/Images/Buttons/delete.gif" />Xóa bỏ</td></tr> 
    <tr>
        <td colspan="4" align="center" style="height: 21px">
            <br />            
            <uc1:PagingAjax ID="PagingAjax1" runat="server" />            
            <br />
        </td>
    </tr>
</table>   
</div>
